import type { HasId, IList, IResult } from "@/types/common";
import { getAxios, commonAxiosJson } from "@/utils/request.js";
/* 获取 号卡订单信息 地址*/
const url = "/back/card-contract-package-order";
/* 获取 号卡订单信息 */
export const getCardContractPackageOrderInfo = <T, D>(params?: D): Promise<IResult<IList<T>>> => {
  return getAxios<IList<T>, D>(url, params);
};
/* 获取 号卡订单详情信息 */
export const getCardContractPackageOrderByIdInfo = <T, D extends HasId>(params: D): Promise<IResult<T>> => {
  return getAxios<T, D>(url + "/" + params.id, params);
};
/* 取消号卡订单 */
export const putCancelCardContractPackageOrderInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url + "/cancel-order", params, "PUT");
};
